package com.safewind.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.safewind.model.RestValue;
import com.safewind.service.IRestValueService;

@Controller
@RequestMapping("/restValue")
public class RestValueController {

	@Resource
	private IRestValueService restValueService;

	@RequestMapping("/getRestValue")
	@ResponseBody
	public Object getRestValue(HttpServletRequest request, HttpSession session) {
		Map<String, Object> map = new HashMap<String, Object>();
		RestValue rv = restValueService.getRestValue();
		map.put("value", rv.getValue());
		map.put("success", true);
		return map;
	}
}
